{%     for phy_int in device_abstract_config.get('physical_interfaces', []) %}
{%         if phy_int.get('interface_type') == 'irb' %}
set groups {{cfg_group}} interfaces irb gratuitous-arp-reply
{%             for li in phy_int.get('logical_interfaces', []) %}
{%                 set unit = li.get('unit') %}
{%                 for ip_addr in li.get('ip_addresses', []) %}
{%                     set address = ip_addr.get('address') %}
{%                     set family = ip_addr.get('family', 'inet') %}
{%                     set gw = ip_addr.get('gateway', '') %}
set groups {{cfg_group}} interfaces irb unit {{unit}} family {{family}} address {{address}} preferred
{%                     if gw != '' %}
set groups {{cfg_group}} interfaces irb unit {{unit}} family {{family}} address {{address}} virtual-gateway-address {{gw}}
{%                     endif %}
{%                 endfor %}
set groups {{cfg_group}} interfaces irb unit {{unit}} proxy-macip-advertisement
set groups {{cfg_group}} interfaces irb unit {{unit}} virtual-gateway-accept-data
set groups {{cfg_group}} interfaces irb unit {{unit}} virtual-gateway-v4-mac 00:00:5e:01:00:01
{%             endfor %}
{%         endif %}
{%     endfor %}

{%     for vlan in device_abstract_config.get('vlans', []) %}
{%         set vlan_name = vlan.get('name') %}
{%         set vlan_id = vlan.get('vlan_id','') %}
{%         set vni = vlan.get('vxlan_id', '') %}
{%         if vlan_id == '' %}
{%             set vlan_id = vni %}
{%         endif %}
{%         for irb_int in vlan.get('interfaces', []) %}
{%             set int_name = irb_int.get('name') %}
{%             if 'irb' not in int_name %}
{%                 continue %}
{%             endif %}
set groups {{cfg_group}} vlans {{vlan_name}} l3-interface {{int_name}}
{%         endfor %}
set groups {{cfg_group}} vlans {{vlan_name}} vlan-id none
{%         if vni != '' %}
set groups {{cfg_group}} vlans {{vlan_name}} vxlan vni {{vni}}
{%         endif %}
{%     endfor %}
